package com.wuyou.sso.common.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 登录日志
 *
 * @author lishangbu
 * @date 2021/1/11
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class LoginLog implements Serializable {
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 登录时间
     */
    private LocalDateTime loginTime;

    /**
     * 登录用户名
     */
    private String accountName;

    /**
     * 远程地址
     */
    private String remoteAddress;

    /**
     * 用户代理字符串
     */
    private String userAgent;

    /**
     * 异常信息
     */
    private String exception;

    /**
     * 设备信息
     */
    private String platform;

    /**
     * 是否成功
     */
    private Boolean success;

    /**
     * 区域信息
     */
    private String region;

    /**
     * 操作系统
     */
    private String os;
}
